home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / documents / ELF / elf_flag3e.txt < prev    next >
Encoding:
Text File  |  1996-11-11  |  3.3 KB  |  79 lines

  1.  
  2. elf_flag(3E)                   Silicon Graphics                   elf_flag(3E)
  3.  
  4. NAME
  5.      elf_flagdata, elf_flagehdr, elf_flagelf, elf_flagphdr, elf_flagscn,
  6.      elf_flagshdr - manipulate flags
  7.  
  8. SYNOPSIS
  9.      cc [flag ...] file ...  -lelf [library ...]
  10.  
  11.      #include <libelf.h>
  12.  
  13.      unsigned elf_flagdata(Elf_Data *data, Elf_Cmd cmd, unsigned flags);
  14.      unsigned elf_flagehdr(Elf *elf, Elf_Cmd cmd, unsigned flags);
  15.  
  16.      unsigned elf_flagelf(Elf *elf, Elf_Cmd cmd, unsigned flags);
  17.      unsigned elf_flagphdr(Elf *elf, Elf_Cmd cmd, unsigned flags);
  18.  
  19.      unsigned elf_flagscn(Elf_Scn *scn, Elf_Cmd cmd, unsigned flags);
  20.      unsigned elf_flagshdr(Elf_Scn *scn, Elf_Cmd cmd, unsigned flags);
  21.  
  22. DESCRIPTION
  23.      These functions manipulate the flags associated with various structures
  24.      of an ELF file.  Given an ELF descriptor (elf), a data descriptor (data),
  25.      or a section descriptor (scn), the functions may set or clear the
  26.      associated status bits, returning the updated bits.  A null descriptor is
  27.      allowed, to simplify error handling; all functions return zero for this
  28.      degenerate case.
  29.  
  30.      cmd may have the following values.
  31.  
  32.      ELF_C_CLR         The functions clear the bits that are asserted in
  33.                        flags.  Only the non-zero bits in flags are cleared;
  34.                        zero bits do not change the status of the descriptor.
  35.  
  36.      ELF_C_SET         The functions set the bits that are asserted in flags.
  37.                        Only the non-zero bits in flags are set; zero bits do
  38.                        not change the status of the descriptor.
  39.  
  40.      Descriptions of the defined flags bits appear below.
  41.  
  42.      ELF_F_DIRTY       When the program intends to write an ELF file, this
  43.                        flag asserts the associated information needs to be
  44.                        written to the file.  Thus, for example, a program that
  45.                        wished to update the ELF header of an existing file
  46.                        would call elf_flagehdr with this bit set in flags and
  47.                        cmd equal to ELF_C_SET.  A later call to elf_update
  48.                        would write the marked header to the file.
  49.  
  50.      ELF_F_LAYOUT      Normally, the library decides how to arrange an output
  51.                        file.  That is, it automatically decides where to place
  52.                        sections, how to align them in the file, etc.  If this
  53.                        bit is set for an ELF descriptor, the program assumes
  54.                        responsibility for determining all file positions.
  55.                        This bit is meaningful only for elf_flagelf and applies
  56.  
  57. Page 1                           Release 6.2
  58.  
  59. elf_flag(3E)                   Silicon Graphics                   elf_flag(3E)
  60.  
  61.                        to the entire file associated with the descriptor.
  62.  
  63.      When a flag bit is set for an item, it affects all the subitems as well.
  64.      Thus, for example, if the program sets the ELF_F_DIRTY bit with
  65.      elf_flagelf, the entire logical file is ``dirty.''
  66.  
  67. EXAMPLE
  68.      The following fragment shows how one might mark the ELF header to be
  69.      written to the output file.
  70.  
  71.           ehdr = elf32_getehdr(elf);
  72.           /* dirty ehdr ... */
  73.           elf_flagehdr(elf, ELF_C_SET, ELF_F_DIRTY);
  74.  
  75. SEE ALSO
  76.      elf(3E), elf_end(3E), elf_getdata(3E), elf_getehdr(3E), elf_update(3E).
  77.  
  78. Page 2                           Release 6.2
  79.